﻿using System.Windows;
using System.Windows.Input;

namespace Sonce.Editor.Tools
{
    //TODO: Combine PanTool and ZoomTool into ViewTool
    public class PanTool : IEditorTool
    {
        #region Members
        private Editor editor;
        private ViewHelper helper;
        #endregion

        #region Constructor
        public PanTool()
        {
            helper = new ViewHelper();
        }
        #endregion

        #region ITool Members
        public Editor Editor
        {
            get
            {
                return this.editor;
            }
            set
            {
                this.editor = value;
                this.helper.Container = this.editor;
            }
        }

        public bool KeyDown(Key key)
        {
            return false;
        }

        public bool KeyUp(Key key)
        {
            return false;
        }

        public bool MouseDown(Point position)
        {
            return false;
        }

        public bool MouseUp(Point position)
        {
            return false;
        }

        public bool MouseMove(Point position, bool isMouseDown)
        {
            if (isMouseDown)
            {
                this.helper.PanBy(position, 500);
            }
            return true;
        }

        public bool MouseEnter()
        {
            return false;
        }

        public bool MouseLeave()
        {
            return false;
        }

        public bool MouseWheel(int delta)
        {
            return false;
        }
        #endregion
    }
}
